import { IView } from "../../../../../mvc/interfaces/IView";
import { ResouceConst } from "../../../../../component/gconst/ResouceConst";
import { ImagesConst } from "../../../../resource/ImagesConst";
import { GTextFormat } from "../../../../../common/GTextFormat";
import { FontUtil } from "../../../../../common/font/FontUtil";
import { ObjCreate } from "../../../common/ObjCreate";
import { Language } from "../../../../../../extend/language/Language";
import { FilterConst } from "../../../../../component/gconst/FilterConst";
import { TilePanel } from "../../../equipment/TilePanel";
import { RuneGuideShopRender } from "./RuneGuideShopRender";
import { DataProvider } from "../../../../../../fl/data/DataProvider";
import { RuneGuideConfig } from "../../../../resource/RuneGuideConfig";
import { ScaleBitmap } from "../../../../../../com/mui/display/ScaleBitmap";
import { GButton } from "../../../../../../com/mui/controls/GButton";
//class RuneGuideShopPanel
    
    export  class RuneGuideShopPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initUI();
            return;
        }

        /* internal  */onOptBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            (this.parent.parent as IView).hide();
            return;
        }

        protected initUI(): void
        {
            this._bg = ResouceConst.getScaleBitmap(ImagesConst.WindowCenterB);
            this._bg.x = 0;
            this._bg.y = 30;
            this._bg.setSize(529, 256);
            addChild(this._bg);
            var loc1=new GTextFormat(FontUtil.songtiName, 16, 16776960, true);
            this._infoTxt = ObjCreate.createTextField(Language.getString(26503), 15, 8, 200, 20, this, loc1);
            this._infoTxt.filters = [FilterConst.colorGlowFilter(16711680)];
            this._infoTxt.textColor = 16776960;
            this._listPanel = new TilePanel();
            this._listPanel.verticalGap = 6;
            this._listPanel.horizontalGap = 6;
            this._listPanel.move(0, 0);
            this._listPanel.setSize(525, 240);
            this._listPanel.x = 10;
            this._listPanel.y = 40;
            this._listPanel.columnWidth = 252;
            this._listPanel.rowHeight = 116;
            this._listPanel.setStyle("cellRenderer", RuneGuideShopRender);
            addChild(this._listPanel);
            this._listPanel.dataProvider = new DataProvider(RuneGuideConfig.instance.list);
            this._optBtn = ObjCreate.createGButton(Language.getString(26504), 0, 302, 74, 24, this, "ButtonRed");
            this._optBtn.x = (width - this._optBtn.width) / 2;
            this._optBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onOptBtnClickHandler);
            return;
        }

        protected /* var */_bg: ScaleBitmap;

        protected /* var */_infoTxt: Object /* flash.text.TextField */;

        protected /* var */_listPanel: TilePanel;

        protected /* var */_optBtn: GButton;
    }
